package com.ddzh.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ddzh.entity.Result;
import com.ddzh.mapper.CheckGroupItemMapper;
import com.ddzh.pojo.CheckGroupItem;
import com.ddzh.service.CheckGroupItemService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import javax.annotation.Resource;

@Service
public class CheckGroupItemServiceImpl extends ServiceImpl<CheckGroupItemMapper, CheckGroupItem> implements CheckGroupItemService {

//    @Autowired
//    private BaseMapper<CheckGroupItemMapper> baseMapper;

    @Resource
    private CheckGroupItemMapper checkGroupItemMapper;
    @Override
    public Long[] findByGroupId(Long groupId) {
//        return new Result(checkGroupItemMapper.findByGroupId(groupId));
        return checkGroupItemMapper.findByGroupId(groupId);
    }

    @Override
    public boolean deleteByGroupId(Long groutId) {
        QueryWrapper<CheckGroupItem> queryWrapper = new QueryWrapper<CheckGroupItem>();
        queryWrapper.eq("group_id",groutId);
        return this.remove(queryWrapper);
    }
}
